package com.fjrcloud.controller;

import com.fjrcloud.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by shengjian.lin on 17-1-7.
 */
@Controller
public class HtmlHomeController {

    @Autowired
    private HttpServletRequest request;

    @Autowired
    private UserService userService;

    @RequestMapping("/")
    public String list(Model model){
        return "home-index";
    }
    @RequestMapping("/login")
    public String login(Model model){

        request.getSession().removeAttribute("user");
        request.getSession().removeAttribute("user-type");

        return "login";
    }
    @RequestMapping("/user/manage")
    public String manage(Model model){
        return "project-group";
    }
    @RequestMapping("/statistical")
    public String statistical(Model model,String data){
        return "statistical";
    }
    @RequestMapping("/print")
    public String print(Model model,String data){
        model.addAttribute("data",data);
        return "print";
    }
}
